package service;

import java.util.Collection;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import common.IPersistenceManager;
import entity.Equipment;
import entity.Staff;

@Service
@Transactional
public class StaffService implements IStaffService {

	@Autowired
	IPersistenceManager persistenceManager;

	@Override
	public Collection<Staff> getAllStaffs() {
		return persistenceManager.all(Staff.class);
	}

	@Override
	public Collection<Equipment> getAllEquipments(Staff staff) {

		return persistenceManager.get(Staff.class, staff.getId())
				.getEquipments();
	}

}
